package cn.edu.uestc.software.mapper;

import cn.edu.uestc.software.pojo.Role;
import cn.edu.uestc.software.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    List<User> selectUsers(@Param("index") int index,
                           @Param("roleName") String roleName,
                           @Param("roleLevel") String roleLevel,
                           @Param("userName") String userName,
                           @Param("departmentName") String departmentName);

    int selectUserCounts(@Param("roleName") String roleName,
                         @Param("roleLevel") String roleLevel,
                         @Param("userName") String userName,
                         @Param("departmentName") String departmentName);

    User SelectUsersById(String id);

    void DeleteById(String id);

    void InsertUser(@Param("username") String username,
                    @Param("password") String password);

    void InsertUser02(Map map);

    void InsertUserJSON(@Param("user") User user);

    void Update(User user);

    User login(String username);
}
